{% extends 'TopxiaWebBundle:Question:question-base-layout.html.twig' %}

{% block heading %}
  {{ question.stem|fill_question_stem_html|bbCode2Html|raw }}
{% endblock %}

{% block body %}

{% if itemResult.status == 'right' %}

  {% set itemResultStatus = '你答对了'|trans %}

{% elseif itemResult.status == 'wrong' %}

  {% set itemResultStatus = '回答错误'|trans %}

{% elseif itemResult.status == 'partRight' %}

  {% set itemResultStatus = '部分回答正确'|trans %}

{% elseif itemResult.status == 'noAnswer' %}

  {% set itemResultStatus = '你未回答'|trans %}

{% endif %}

  <div class="question-fill-inputs ">
    <div class="">
      <div class="homework-question-fill">
         <ul>
          {% for index,rightAnswer in question.answer %}

            <li>
              填空({{index+1}})： 正确答案
              <strong class="question-text-success">{{ rightAnswer|join(' 或 '|trans) }}</strong>
              {% if itemResult.answer[index] or itemResult.answer[index] is same as(0) or itemResult.answer[index] is same as('0') %}
             {{'回答是'|trans}}

              <strong class="question-text-danger">{{ itemResult.answer[index]|default('') }}</strong>。
              {% else %}
              {{'未回答'|trans}}
              {% endif %}

              {% if itemResult.answer[index]|default(null) in rightAnswer %}
                  <span class="glyphicon glyphicon-ok question-text-success">

              {% else %}
                  <span class="glyphicon glyphicon-remove question-text-danger">
              {% endif %}
            </li>

          {% endfor %}

         </ul>
      </div>
    </div>
  </div>
{% endblock %}

{% block footer %}

{% endblock %}